﻿Imports System
Imports System.Drawing

Namespace System.Workflow.ComponentModel.Design
    Friend NotInheritable Class ConnectorDragDropGlyph
        Inherits DesignerGlyph
        ' Methods
        Public Sub New(ByVal connectorIndex As Integer, ByVal connectorCenter As Point)
            Me.connectorIndex = connectorIndex
            Dim ambientTheme As AmbientTheme = WorkflowTheme.CurrentTheme.AmbientTheme
            Me.glyphPoint = New Point((connectorCenter.X - (ambientTheme.DropIndicatorSize.Width / 2)), (connectorCenter.Y - (ambientTheme.DropIndicatorSize.Height / 2)))
        End Sub

        Public Overrides Function GetBounds(ByVal designer As ActivityDesigner, ByVal activated As Boolean) As Rectangle
            Return New Rectangle(Me.glyphPoint, WorkflowTheme.CurrentTheme.AmbientTheme.DropIndicatorSize)
        End Function

        Protected Overrides Sub OnPaint(ByVal graphics As Graphics, ByVal activated As Boolean, ByVal ambientTheme As AmbientTheme, ByVal designer As ActivityDesigner)
            ActivityDesignerPaint.DrawImage(graphics, AmbientTheme.DropIndicatorImage, Me.GetBounds(designer, activated), DesignerContentAlignment.Fill)
        End Sub


        ' Properties
        Public Overrides ReadOnly Property Priority As Integer
            Get
                Return 2
            End Get
        End Property


        ' Fields
        Private connectorIndex As Integer
        Private glyphPoint As Point = Point.Empty
    End Class
End Namespace

